package org.swirrel.component;

import org.swirrel.Swirrel;
import javax.swing.JFrame;
import java.awt.GraphicsConfiguration;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

public class SwFrame extends JFrame {

    private WindowListener processListener = new WindowAdapter() {
        @Override
        public void windowOpened(WindowEvent we) {
            process();
        }
    };

    {
        this.addWindowListener(processListener);
    }

    public SwFrame() {
        super();
    }

    public SwFrame(GraphicsConfiguration gc) {
        super(gc);
    }

    public SwFrame(String title) {
        super(title);
    }

    public SwFrame(String title, GraphicsConfiguration gc) {
        super(title, gc);
    }

    public void process() {
        Swirrel.process(this);
    }
}
